package com.haier.nengyuan.myapplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

public class PaymentActivity extends Activity implements View.OnClickListener {
    private TextView mTvNext;
    private ImageView close;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager
                .LayoutParams.FLAG_FULLSCREEN);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_payment);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            //透明状态栏
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            //透明导航栏
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }
        mTvNext = (TextView) findViewById(R.id.tv_next);
        mTvNext.setFocusable(true);
        mTvNext.requestFocus();
        close = (ImageView) findViewById(R.id.close);
        mTvNext.setOnClickListener(this);
        close.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.tv_next) {
            Intent intent = new Intent(PaymentActivity.this, PaySuccessActivity.class);
            PaymentActivity.this.startActivity(intent);
        }
        if (id == R.id.close) {
            PaymentActivity.this.finish();
        }
    }
}
